import { createRouter, createWebHashHistory } from "vue-router"
const routes = [
    {
        path: '/login',
        name: 'login',
        component: () => import("../views/login")
    },
    {
        path: '/',
        name: '/',
        component: () => import("../layout"),
        redirect: '/users',
        children: [
            {
                path: 'users',
                name: '用户列表',
                component: () => import('@/views/users/index.vue')
            },
            {
                path: 'categories',
                name: 'categories',
                component: () => import('@/views/categories/index.vue')
            },
            {
                path: 'goods',
                name: '商品列表',
                component: () => import('@/views/goods/index.vue')
            },
            {
                path: 'orders',
                name: 'orders',
                component: () => import('@/views/orders/index.vue')
            },
            {
                path: 'params',
                name: 'params',
                component: () => import('@/views/params/index.vue')
            },
            {
                path: 'reports',
                name: 'reports',
                component: () => import('@/views/reports/index.vue')
            },
            {
                path: 'rights',
                name: 'rights',
                component: () => import('@/views/rights/index.vue')
            },
            {
                path: 'roles',
                name: 'roles',
                component: () => import('@/views/roles/index.vue')
            }
        ]
    }
]
const router = createRouter({
    history: createWebHashHistory(),
    routes
})
export default router